{extend name="base"}
{block name="title"}房间强制解散{/block}
{block name="head"}{/block}
{block name="body"}
<body class="mainbody">
<form>

<!--导航栏-->
<div class="location">
  <a href="javascript:history.back(-1);" class="back"><i class="iconfont icon-up"></i><span>返回上一页</span></a>
  <a href="{:url('index/home')}" class="home"><i class="iconfont icon-home"></i><span>首页</span></a>
  <i class="arrow iconfont icon-arrow-right"></i>
  <span>房间强制解散</span>
</div>
<!--/导航栏-->

<!--内容-->
<div id="floatHead" class="content-tab-wrap">
  <div class="content-tab">
    <div class="content-tab-ul-wrap">
      <ul>
        <li><a class="selected" href="javascript:;">房间强制解散</a></li>
      </ul>
    </div>
  </div>
</div>

<div class="tab-content">
  <dl>
    <dt>六位房间号：</dt>
    <dd>
      <input type="text" class="input normal" autocomplete="off" name="RoomID" placeholder="请输入六位房间号" />
    </dd>
  </dl>
</div>
<!--/内容-->

<!--工具栏-->
<div class="page-footer">
  <div class="btn-wrap">
    <input type="button" name="btnSubmit" value="确认解散" class="btn" />
  </div>
</div>
<!--/工具栏-->

</form>
<script>
$(function () {
  $('input[name=btnSubmit]').click(function () {
    var RoomID = $('input[name=RoomID]').val();
    if (!RoomID) {
      alert("请输入六位房间号");
      return false;
    }
    var url = "{:url('dismiss')}";
    $.post(url, {RoomID:RoomID}, function (resp, state, xhr) {
      console.log(resp);
      if (resp.errno != 0) {
        alert(resp.error);
        return;
      }
      var a = resp.data;
      dialog({ // 二次确认
        title: '房间强制解散',
        content: '是否强制解散房间[' + RoomID + ']?' +
        '<br/>渠道ID:' + a.Channel +
        '<br/>渠道名:' + a.ChannelName +
        '<br/>游戏ID:' + a.KindID +
        '<br/>游戏名:' + a.KindName +
        '<br/>服务ID:' + a.ServerID +
        '<br/>服务名:' + a.ServerName +
        '<br/>服端口:' + a.ServerPort,
        ok: function () {
          console.log("ok", url);
          $.post(url, {RoomID:RoomID, Agree:1}, function (resp, state, xhr) {
            console.log(resp);
            alert(resp.error);
            if (resp.errno == 0) {
              location.reload();
            }
          });
          return false;
        }
      }).showModal();
    });
    return false;
  });
});
</script>
</body>
{/block}